package com.bsoft.exchange.service;

import com.bsoft.exchange.dao.hss.MedicalAppointmentDetailMapper;
import com.bsoft.exchange.domain.MedicalAppointmentDetail;
import com.bsoft.exchange.vo.MedicalAppointmentDetailVO;
import com.github.dozermapper.core.DozerBeanMapperBuilder;
import com.github.dozermapper.core.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MedicalAppointmentDetailService {

    private Mapper mapper = DozerBeanMapperBuilder.buildDefault();

    @Autowired
    private MedicalAppointmentDetailMapper medicalAppointmentDetailMapper;

    /**
     * 查看报告详情
     * @param regRecordCode 预约记录编号
     * @param identityType 证件类型
     * @param identityNo 证件号码
     * @param orgId 机构编号
     * @return
     */
    public MedicalAppointmentDetailVO getDetailByParams(String regRecordCode, String identityType,String identityNo,String orgId){
        MedicalAppointmentDetailVO medicalAppointmentDetailVO = null;
        MedicalAppointmentDetail medicalAppointmentDetail = medicalAppointmentDetailMapper.getDetailByParams(regRecordCode, identityType, identityNo, orgId);
        if(medicalAppointmentDetail != null){
            medicalAppointmentDetailVO = mapper.map(medicalAppointmentDetail, MedicalAppointmentDetailVO.class);
        }
        return medicalAppointmentDetailVO;
    }
}
